import javax.swing.event.*;
import java.awt.event.*;
public class MouseRead extends MouseInputAdapter{
	private int lx,ly;
	private Saolei fram;
	MouseRead(int x,int y,Saolei fram){
		this.lx=x;
		this.ly=y;
		this.fram=fram;
	}
	public void mousePressed(MouseEvent e){
		if(!fram.isGameOver())
			if(e.getButton()==1){
				fram.setOpen(lx,ly);
				System.out.println("a left press"+lx+":"+ly+"|"+e.getButton()+"|"+fram.getTime());
			}
			else if(e.getButton()==3){
				fram.setClose(lx,ly);
				System.out.println("a right press"+lx+":"+ly+"|"+e.getButton()+"|"+fram.getTime());
			}
	}
}
